#!/bin/bash

################################
### npm run build:prod
################################
#npm run build:prod
#if [ $? -ne 0 ];then
#  echo "npm run failed"
#  exit 1
#fi
echo "npm run successful"
echo "*****************************"
echo "*** step2 npm run successful "
echo "*****************************"

# shellcheck disable=SC2046
docker rmi $(docker images | grep "none" | awk '{print $3}')
docker build -t registry.cn-shanghai.aliyuncs.com/tuyd/ywd-ui:1.0.0 .
if [ $? -ne 0 ];then
  echo "image build failed"
  exit 1
fi
echo "image build successful"
